﻿@inject ModalService _modalService

<div>
    <Button Type="ButtonType.Primary" OnClick="ShowModal">
        Modal
    </Button>
    <Modal Title="@("Modal")"
           @bind-Visible="@_visible"
           OkText="@("Agree")"
           CancelText="@("Dismiss")">
        <p>Bla bla ...</p>
        <p>Bla bla ...</p>
        <p>Bla bla ...</p>
    </Modal>

    <Button OnClick="HandleConfirm">Confirm</Button>

</div>


@code {
    private bool _visible = false;
    private void ShowModal()
    {
        _visible = true;
    }

    private void HandleConfirm()
    {
        _modalService.Confirm(new ConfirmOptions()
        {
            Title = "Confirm",
            Icon = @<Icon Type="@IconType.Outline.ExclamationCircle" />,
            Content = "Bla bla ...",
            OkText = "Agree",
            CancelText = "Dismiss"
        });
    }
}
